home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / diverses / cexpress / screen / colcolrb.asm < prev    next >
Encoding:
Assembly Source File  |  1989-05-03  |  1.3 KB  |  50 lines

  1. ;void  column_color_b(col,row,depth,color);
  2. ;  unsigned char  col,row,depth,color;
  3.  
  4.     EXTRN  _memory_model:byte
  5.     EXTRN  _video_page:byte
  6.  
  7. _TEXT    SEGMENT BYTE PUBLIC 'CODE'
  8.     ASSUME CS:_TEXT
  9.     PUBLIC _column_color_b
  10. _column_color_b proc near
  11.     push bp            ;
  12.     mov  bp,sp        ;set stack frame    
  13.     push di            ;
  14.     cmp  _memory_model,0    ;near or far?
  15.     jle  begin        ;jump if near
  16.     inc  bp            ;else add 2 to BP
  17.     inc  bp            ;
  18. begin:    mov  bh,_video_page    ;set video page
  19.     mov  dl,[bp+4]        ;Col in DL
  20.     dec  dl            ;count from 0
  21.     mov  dh,[bp+6]        ;Row in DH
  22.     dec  dh            ;count from 0
  23.     sub  ax,ax        ;
  24.     mov  al,[bp+8]        ;depth
  25.     mov  di,ax        ;
  26.     or   di,di        ;check for null
  27.     jz   L2            ;quit if null
  28.     mov  bl,[bp+10]        ;new attribute in BL
  29.     mov  cx,1        ;number chars to write
  30. L1:    mov  ah,2        ;function to set cursor
  31.     int  10h        ;set cursor
  32.     mov  ah,8        ;func to read char:attri
  33.     int  10h        ;now AL:AH has char:attri
  34.     mov  ah,9        ;func to write char:attri
  35.     int  10h        ;write char w new attri
  36.     cmp  dh,24        ;bottom of column?
  37.     je   L2            ;quit at bottom
  38.     inc  dh            ;point to next row
  39.     dec  di            ;dec char counter
  40.     jnz  L1            ;loop if not finished
  41. L2:    pop  di            ;
  42.     pop  bp            ;
  43.     cmp  _memory_model,0    ;quit
  44.     jle  quit        ;
  45.     db   0CBh        ;RET far
  46. quit:    ret            ;RET near
  47. _column_color_b endp
  48. _TEXT    ENDS
  49.     END
  50.